package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.pojo.Notes;

import java.util.List;

@Mapper
public interface NoteMapper {
//    @Select("select * from notes where user_id=#{userId} order by created_at #{sorted}")
    List<Notes> noteList(Integer userId, String sorted);
    @Insert("insert into notes(user_id, content, text) values(#{userId}, #{content}, #{text})")
    void addNote(Notes notes);
    @Delete("delete from notes where id=#{id}")
    void delNote(Integer id);
    @Update("update notes set content=#{content}, text=#{text} where id=#{id}")
    void updateNote(Notes notes);
}
